Add Async support with AsyncClient and AsyncOauthClient #5#14
Add Async support with AsyncClient and AsyncOauthClient #5#14francescobianco merged 4 commits intoopenapi:mainfrom
Conversation
|
Thanks @Deadpool2000 , is it possible here split all classes into different files based on files standard names? in a way to have more smallest files instead a single large file for code |
|
Thanks for the great suggestion! I completely agree that splitting the classes is a much cleaner approach. I've just pushed an update where I refactored the code to extract the classes into their own separate files based on their standard names:
To make sure this doesn't break any existing functionality or user implementations, I updated Let me know if this looks good to you or if you need any further adjustments! |
francescobianco
left a comment
There was a problem hiding this comment.
Great job! The implementation is clear, well-organized, and easy to follow. @Deadpool2000
There was a problem hiding this comment.
@Deadpool2000 You’re very close to becoming the top contributor to the project—amazing work so far! 🚀
If you’d like to help it grow even more, feel free to share your work with your friends and colleagues using this link.
https://github.com/openapi/openapi-python-sdk/graphs/contributors
And don’t forget to give the project a ⭐ on GitHub if you haven’t already!
This PR addresses the issue where the SDK was blocking the event loop in async frameworks like aiohttp or FastAPI. I've added full asynchronous support and improved resource management across the board.
What's new?
Context Manager Support: All clients (both sync and async) now support context managers (with and async with). This ensures that the underlying connection pool is properly closed after use, preventing resource leaks.
Simplified Imports: You can now import clients directly from the package root:
from openapi_python_sdk import Client, AsyncClientBetter Tests: Added a new test suite for the async implementation using IsolatedAsyncioTestCase (standard in Python 3.10+).
Quick Usage Example
Verification
Updated the README.md with these usage examples to help users get started.
Let me know if you have any feedback!